package com.bdqn.staffmanagementsystem.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.Locale;
@Configuration
public class MyConfig implements WebMvcConfigurer {
    @Bean
    public LocaleResolver myLocale(){
        return new MyLocaleResolver();
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new MyInterceptor()).addPathPatterns("/**").
                excludePathPatterns("/","/toIndex","/asserts/css/*","/asserts/js/*","/asserts/img/*","/Employee/formsignin");
    }
}
